package StrategyPattern;

public abstract class Duck {
    
    private FlyBehavior flyBehavior;
    
    public abstract void display();
    
    public void swim() {
        System.out.println("I can swim!");
    }
    

    public void performFly() {
        flyBehavior.fly();
    }
    
    public void setFlyBehavior(FlyBehavior flyBehavior) {
        this.flyBehavior = flyBehavior;
    }
    
}
